//
//  LHChannelTitleView.m
//  channelDemo
//
//  Created by zhouLiHuan on 2017/2/6.
//  Copyright © 2017年 zhouLiHuan. All rights reserved.
//

#import "LHChannelTitleView.h"

@interface LHChannelTitleView ()
{
    UILabel *_titleLabel;
    UILabel *_subtitleLabel;
}

@end

@implementation LHChannelTitleView

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self buildUI];
    }
    return self;
}

- (void)buildUI{
    CGFloat labelWidth = self.bounds.size.width/2.0f;
    _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, labelWidth, self.bounds.size.height)];
    _titleLabel.textColor = [UIColor blackColor];
    [self addSubview:_titleLabel];
    
    _subtitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(labelWidth, 0, labelWidth, self.bounds.size.height)];
    _subtitleLabel.textColor = [UIColor blackColor];
    _subtitleLabel.textAlignment = NSTextAlignmentRight;
    _subtitleLabel.font = [UIFont systemFontOfSize:15.0f];
    [self addSubview:_subtitleLabel];
    
}

- (void)setTitle:(NSString *)title{
    _title = title;
    _titleLabel.text = title;
}

- (void)setSubTitle:(NSString *)subTitle{
    _subTitle = subTitle;
    _subtitleLabel.text = subTitle;
}



@end
